/*
 *  MainWindow.h
 *  iActivator
 *
 *  Created by The Operator on 19/07/07.
 *  Copyright 2007 The Operator. All rights reserved.
 *
 * This software is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public
 * License version 2, as published by the Free Software Foundation.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 *
 * See the GNU General Public License version 2 for more details
 */ 

#import <Cocoa/Cocoa.h>


class PhoneInteraction;

@interface MainWindow : NSWindow
{
@public

	IBOutlet NSWindow* imeiDialog;
	IBOutlet NSTextField* imeiTextField;
	IBOutlet NSTextField* iccidTextField;
	IBOutlet NSWindow* waitDialog;
	IBOutlet NSTextField* waitDialogMessage;
	IBOutlet NSImageView* waitDialogImage;
	IBOutlet NSButton* waitDialogCancel;
	IBOutlet NSProgressIndicator* waitDialogSpinner;
	IBOutlet NSButton* putPEMButton;
	IBOutlet NSButton* returnToJailButton;
	IBOutlet NSButton* activateButton;
	IBOutlet NSButton* deactivateButton;
	IBOutlet NSButton* jailbreakButton;
	IBOutlet NSButton* backupButton;
	IBOutlet NSTextField* statusBar;
	IBOutlet NSProgressIndicator* statusSpinner;
	IBOutlet NSWindow* aboutBox;


@private

	NSDistributedNotificationCenter		*distNotificationCenter;
	bool								m_statusSpinning;
	bool m_connected;
	bool m_recoveryMode;
	bool m_restoreMode;
	bool m_jailbroken;
	bool m_activated;
	bool m_performingJailbreak;
	bool m_returningToJail;
	bool m_modal;
	PhoneInteraction *m_phoneInteraction;
	NSAlert *m_sheet;
}

- (void)setConnected:(bool)connected;
- (bool)isConnected;

- (void)setRecoveryMode:(bool)inRecovery;
- (bool)isInRecoveryMode;

- (void)setRestoreMode:(bool)inRestore;
- (bool)isInRestoreMode;

- (void)setJailbroken:(bool)jailbroken;
- (bool)isJailbroken;

- (void)setActivated:(bool)activated;
- (bool)isActivated;

- (void)displayAlert:(NSString*)title message:(NSString*)msg;

- (void)setStatus:(NSString*)text spinning:(bool)spin;
- (void)updateStatus;

- (void)startDisplayWaitingSheet:(NSString*)title message:(NSString*)msg image:(NSImage*)img
					cancelButton:(bool)cancel runModal:(bool)modal;
- (void)endDisplayWaitingSheet;

- (IBAction)generateActivation:(id)sender;
- (IBAction)putPEMOnPhone:(id)sender;
- (IBAction)activate:(id)sender;
- (IBAction)deactivate:(id)sender;
- (IBAction)performJailbreak:(id)sender;
- (IBAction)returnToJail:(id)sender;

- (IBAction)imeiDialogCancel:(id)sender;
- (IBAction)imeiDialogOk:(id)sender;

- (IBAction)waitDialogCancel:(id)sender;

- (IBAction)showAboutPanel:(id)sender;

@end
